<!--
 * @Author: liubei
 * @Date: 2021-12-31 17:06:53
 * @LastEditTime: 2022-01-01 14:22:06
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    analysis

    <script>
        var url = 'ws://' + window.location.host + '/ws/1';

        socket = new WebSocket(url);
        socket.onopen = function () {
            console.log('connected to', url);
        }
        socket.onmessage = function (event) {
            var data = JSON.parse(event.data);
            console.log(data)
        }
        socket.onclose = function () {
            console.log('close connect to', url);
        }
    </script>
</body>

</html>